<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/cookie.js"></script>
</head>
<body>
    <button class="btn">模拟登陆成功</button>
</body>
<script>
    var btn = document.getElementsByClassName("btn")[0];


    // 登陆成功
    // 1. 存cookie => 记录当前登陆的用户
    // 2. 跳转主页 
    btn.onclick = function(){
        console.log("登陆成功");


        setCookie("lgc","a123123",7 * 24 * 60 * 60);

        location.href = "./14 cookie应用_标识用户身份.html";
    }

</script>
</html>